* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  /* 线性渐变 渐变轴 200° */
  background: linear-gradient(200deg, #f3e7e9, #e3eeff);
  display: flex;
  justify-content: center;
  align-items: center;
}

.share-button {
  position: relative;
  width: 300px;
  height: 80px;
  background-color: #fff;
  border-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  /* 动画过渡 */
  transition: all 0.3s linear;
  /* 父盒子装不下的时候 隐藏子盒子 */
  overflow: hidden;
}

/* 鼠标到分享按钮上, 按钮放大 */
.share-button:hover {
  transform: scale(1.03);
}

/* 绝对定位 ==> 行内元素会转成块级元素 */
.share-button span {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: #333;
  color: #fff;
  font-size: 18px;
  text-align: center;
  line-height: 80px;
  z-index: 1;
  transition: all 0.5s ease-in-out;
  transition-delay: 0.2s;
}

.share-button:hover span {
  /* 向左移一个 span 的宽度的距离 */
  transform: translateX(-100%);
}

/* flex: 1 盒子进行等分 */
.share-button a {
  flex: 1;
  /* border: 1px solid red; */
  text-align: center;
  color: #333;
  font-size: 26px;
  transform: translateX(-100%);
  /* 设置不透明度 */
  opacity: 0;

  transition: all 0.5s ease-in-out;
}

.share-button:hover a {
  transform: translateX(0);
  opacity: 1;
}

/* :nth-of-type(n) 匹配同类型中的第n个同级兄弟元素 */
.share-button a:nth-of-type(1) {
  transition-delay: 0.5s;
}
.share-button a:nth-of-type(2) {
  transition-delay: 0.4s;
}
.share-button a:nth-of-type(3) {
  transition-delay: 0.3s;
}
.share-button a:nth-of-type(4) {
  transition-delay: 0.2s;
}
